#########################################################
#Figure D3: Mechanism Results with Different Expectations
#########################################################

data <- read.dta13("./temp/figd3data.dta")
data<- data[data$var=="z_p_wealth",]
data$type <- c("national","personal")
ggplot(data, aes(as.factor(type), coef)) + 
  geom_pointrange(aes(ymin=coef-1.96*stderr, ymax=coef + 1.96*stderr), shape=16, size=1.7, color= "gray40") +
  geom_hline(yintercept = 0, color="red", lwd=1.2) + 
  theme_nice() + ylab("Wealth Effect on Expectations from Leave") + xlab("Expectations Type") + 
  theme(axis.title = element_text(size=14),
        axis.text = element_text(size=12),
        panel.grid.minor = element_blank(),
        panel.grid.major.y = element_blank(),
        panel.grid.major.x = element_line(linetype="solid")) + 
  scale_x_discrete(labels=c("National Circumstances", "Personal Circumstances"))   + 
  scale_y_continuous(breaks=c(-.05, -0.02, 0, 0.02, 0.05) , limits=c(-.05,.08)) + coord_flip() 
ggsave("./figures/figd3.pdf")
rm(data)